import request from '@/utils/request'

export function getUsers(params) {
    return request({
      url: "/sys/user",
      params
    })
  }
/*
获取员工综合列表
*/

export function getEmployeeSimple() {
  return request({
    url: '/sys/user/simple'
  })
}

export function getEmployeeList(params) {
  return request({
    url: '/sys/user',
    params
  })
}

  export function saveUserDetailById(data){
    return request({
        url:`/sys/user/${data.id}`,
        method:'put',
        data
    })
}

// 获取岗位信息
export function getUserJobsById(id){
    return request({
        url:`/employees/${id}/jobs`
    })
}

// 保存岗位信息
export function saveUserJobsById(data){
    return request({
        url:`/employees/${data.id}/jobs`,
        method:'put',
        data
    })
}

// 获取个人信息
export function getUserMsgById(id){
    return request({
        url:`/employees/${id}/personalInfo`
    })
}

// 保存个人信息
export function saveUserMsgById(data){
    return request({
        url:`/employees/${data.userId}/personalInfo`,
        method:'put',
        data
    })
}


/*
导入员工数据
*/
export function importEmployee(data){
  return request({
    url: '/sys/user/batch',
    method: 'post',
    data
  })
}


export function delUsers(id) {
  return request({
    url: `/sys/user/${id}`,
    method: 'delete'
  })
}
